<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class HT_Model_administrator_models_listappointment extends Zend_Db_Table {//ten class fai viet hoa

   protected $_db;

    public function __construct() {
        $this->_name = "list_appointment";
        $this->_db = Zend_Registry::get('dbMain');
        parent::init();
    }
    public function getAll($where){
        $sql = "select * from list_appointment where ".$where;
        $retval = $this->_db->fetchAll($sql);
        return $retval;
    }
    public function getAllExentsion($where){
        $sql = "select LA.*, PA.partner_name, PA.rate, PA.image, PA.link, LO.address, LO.map, LO.location_id, LO.phone
        from list_appointment LA inner join partners PA on LA.partner_id = PA.id left join location LO on PA.location_id = LO.location_id where ".$where;
        $retval = $this->_db->fetchAll($sql);
       
        return $retval;
    }
    public function findById($id){
        $sql = "select * from list_appointment where id = $id";
        $retval = $this->_db->fetchRow($sql);
        return $retval;
    }
    public function listCatAppoint(){
        $dataCat[] = array("id"=>1, "name"=>"Đặt hẹn khám");
        $dataCat[] = array("id"=>2, "name"=>"Đặt hẹn tiêm");
        $dataCat[] = array("id"=>3, "name"=>"Đăng ký lớp học tiền sản");
        $dataCat[] = array("id"=>4, "name"=>"Đặt hẹn tư vấn bảo hiểm");
        return $dataCat;
    }
}

?>
